package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ShopRentMapper;
import com.ruoyi.business.domain.ShopRent;
import com.ruoyi.business.service.IShopRentService;

/**
 * 商铺出租Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class ShopRentServiceImpl implements IShopRentService 
{
    @Autowired
    private ShopRentMapper shopRentMapper;

    /**
     * 查询商铺出租
     * 
     * @param id 商铺出租主键
     * @return 商铺出租
     */
    @Override
    public ShopRent selectShopRentById(Long id)
    {
        return shopRentMapper.selectShopRentById(id);
    }

    /**
     * 查询商铺出租列表
     * 
     * @param shopRent 商铺出租
     * @return 商铺出租
     */
    @Override
    public List<ShopRent> selectShopRentList(ShopRent shopRent)
    {
        return shopRentMapper.selectShopRentList(shopRent);
    }

    /**
     * 新增商铺出租
     * 
     * @param shopRent 商铺出租
     * @return 结果
     */
    @Override
    public int insertShopRent(ShopRent shopRent)
    {
        shopRent.setCreateTime(DateUtils.getNowDate());
        return shopRentMapper.insertShopRent(shopRent);
    }

    /**
     * 修改商铺出租
     * 
     * @param shopRent 商铺出租
     * @return 结果
     */
    @Override
    public int updateShopRent(ShopRent shopRent)
    {
        shopRent.setUpdateTime(DateUtils.getNowDate());
        return shopRentMapper.updateShopRent(shopRent);
    }

    /**
     * 批量删除商铺出租
     * 
     * @param ids 需要删除的商铺出租主键
     * @return 结果
     */
    @Override
    public int deleteShopRentByIds(Long[] ids)
    {
        return shopRentMapper.deleteShopRentByIds(ids);
    }

    /**
     * 删除商铺出租信息
     * 
     * @param id 商铺出租主键
     * @return 结果
     */
    @Override
    public int deleteShopRentById(Long id)
    {
        return shopRentMapper.deleteShopRentById(id);
    }
}
